from django.db import models
from django.utils.translation import gettext_lazy as _


class Department(models.Model):
    """
    部门表：用于存储部门信息
    """
    department_id = models.AutoField(primary_key=True)
    department_name = models.CharField(max_length=100, unique=True, verbose_name=_("Department Name"))
    description = models.TextField(null=True, blank=True, verbose_name=_("Description"))
    created_at = models.DateTimeField(auto_now_add=True, verbose_name=_("Created At"))
    updated_at = models.DateTimeField(auto_now=True, verbose_name=_("Updated At"))

    class Meta:
        db_table = "departments"
        verbose_name = _("Department")
        verbose_name_plural = _("Departments")

    def __str__(self):
        return self.department_name